package com.yjb.demo.elasticsearch.config.elasticsearch;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @description 
 * @author yinjinbiao
 * @create 2024/1/11 16:48
 * @version 1.0
 */
@Configuration
public class ElasticsearchConfig {

	@Bean
	public RestHighLevelClient restHighLevelClient(ElasticsearchProperties elasticsearchProperties){
		return new RestHighLevelClient(RestClient.builder(
				HttpHost.create(elasticsearchProperties.getClient())));
	}
}
